package com.zxl.finance.service.impl;

import com.zxl.finance.domain.AccountFinanceInfo;
import com.zxl.finance.repository.AccountFinanceRepository;
import com.zxl.finance.service.AccountFinanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @auther: zxl
 * @creater: 2018-07-13
 * @description: accountFinanceService的实现
 **/
@Service
public class AccountFinanceServiceImpl  implements AccountFinanceService  {

    @Autowired
    private AccountFinanceRepository accountFinanceRepository;

    @Override
    public AccountFinanceInfo getById(String id) {
        Optional<AccountFinanceInfo> t=accountFinanceRepository.findById(id);
        return t.isPresent()?t.get():null;
    }

    @Override
    public AccountFinanceInfo save(AccountFinanceInfo accountFinanceInfo) {
        return accountFinanceRepository.save(accountFinanceInfo);
    }
}
